package mapeditor;
import java.io.*;

/**
 *
 * @author  tamastoth
 */
public class OpenDlg extends javax.swing.JDialog {
    
    /** Creates new form OpenDlg */
    public OpenDlg(java.awt.Frame parent, boolean modal, boolean open) {
        super(parent, modal);
        initComponents();
        if (open)
            this.jFileChooser1.setDialogType(javax.swing.JFileChooser.OPEN_DIALOG);
        else
            this.jFileChooser1.setDialogType(javax.swing.JFileChooser.SAVE_DIALOG);
    }
    
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
    private void initComponents() {
        jFileChooser1 = new javax.swing.JFileChooser();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        jFileChooser1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jFileChooser1ActionPerformed(evt);
            }
        });

        getContentPane().add(jFileChooser1, java.awt.BorderLayout.CENTER);

        pack();
    }
    // </editor-fold>//GEN-END:initComponents

    private void jFileChooser1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jFileChooser1ActionPerformed
// TODO add your handling code here:
        setVisible(false);
    }//GEN-LAST:event_jFileChooser1ActionPerformed
    public File getFile() {
        return jFileChooser1.getSelectedFile();
    }
    /**
     * @param args the command line arguments
     */
 
    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JFileChooser jFileChooser1;
    // End of variables declaration//GEN-END:variables
    
}
